home *** CD-ROM | disk | FTP | other *** search
- ; APL2C.ASM - APL to C Assembler functions ...
- ; Support for APL2PC to C interface
- ; ASM used to avoid use of C STDLIB fns..
-
- ARG0 EQU [bp + 4] ;offset of first arg on stack
-
- SVP EQU 0B6H ; Interrupt number for SVP.
- $GETM EQU 4 ; Get storage from the Workspace.
- $RELM EQU 5 ; Return storage to Workspace.
-
- DOSSEG ; std segment conventions
- .MODEL SMALL ; Small memory model
-
-
- .CODE ; code segment
-
- ; APL_CS - return APL's code segment value
- ; int apl_cs(void)
- PUBLIC _apl_cs
- _apl_cs PROC
- push bp
- mov bp,sp
-
- int 3 ; provides breakpoint under CODEVIEW
- push ds
- push es
- push di
- push si
-
- mov ax,cs ; prepare to get var ptr
- sub ax,10h ; adjust for offset
- ; return to C
- pop si
- pop di
- pop es
- pop ds
-
- pop bp
-
- ret
- _apl_cs ENDP
-
-
-
- ;SVP_GETM uses SVP service to get block of (APL WS) memory
- ; int svp_getm(int npars)
-
- PUBLIC _svp_getm
- _svp_getm PROC
- push bp
- mov bp,sp
-
- push si
- push di
- push ds
- push es
- int 3
- mov dx,ARG0 ; #pars to DX
- mov ah,$GETM
- int SVP
- mov ax,ds ; return DS
-
- pop es
- pop ds
- pop di
- pop si
- pop bp
- ret
-
- _svp_getm ENDP
-
- ;SVP_RELM uses SVP service to release block of (APL WS) memory
- ; int svp_relm(int segmt)
-
- PUBLIC _svp_relm
- _svp_relm PROC
- push bp
- mov bp,sp
-
- push si
- push di
- push ds
- push es
-
- mov ds,ARG0 ; segment to DS
- mov ah,$RELM
- int SVP
- mov ax,cx ; return CX (error code,if any)
-
- pop es
- pop ds
- pop di
- pop si
- pop bp
- ret
-
- _svp_relm ENDP
-
- END